{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=366
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var
	n, i, tt : longint;
	a : array[0..110] of boolean;
 
begin
	reset(input,'input.txt');
	rewrite(output,'output.txt');
	read(n);
	fillchar(a, sizeof(a), 0);
	a[1] := true;
	a[2] := true;
	a[3] := false;
	for i := 4 to n do begin
		tt := i mod 3;
		if tt = 0 then a[i] := (not a[i - 1]) or (not a[i - 2]) else
		if tt = 1 then a[i] := (not a[i - 1]) or (not a[i - 3]) else 
		if tt = 2 then a[i] := (not a[i - 1]) or (not a[i - 2]) or (not a[i - 3]);	
	end;
	if a[n] then write(1) else write(2);
end.